import request from '@/utils/request'

// 查询用户证书列表
export function listCredentials(query) {
  return request({
    url: '/credentials/credentials/list',
    method: 'get',
    params: query
  })
}

// 查询用户证书详细
export function getCredentials(credentialsId) {
  return request({
    url: '/credentials/credentials/' + credentialsId,
    method: 'get'
  })
}

// 新增用户证书
export function addCredentials(data) {
  return request({
    url: '/credentials/credentials',
    method: 'post',
    data: data
  })
}

// 修改用户证书
export function updateCredentials(data) {
  return request({
    url: '/credentials/credentials',
    method: 'put',
    data: data
  })
}

// 删除用户证书
export function delCredentials(credentialsId) {
  return request({
    url: '/credentials/credentials/' + credentialsId,
    method: 'delete'
  })
}

// 导出用户证书
export function exportCredentials(query) {
  return request({
    url: '/credentials/credentials/export',
    method: 'get',
    params: query
  })
}

// 文件上传
export function uploadFile(data) {
  return request({
    url: '/credentials/credentials/uploadFile',
    method: 'post',
    data: data
  })
}
